﻿using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using NLog;

namespace hello.csharp.controller
{
    [CustomRoute]
    public class SampleController : Controller
    {
        private readonly ILogger _logger = LogManager.GetCurrentClassLogger();

        // GET api/values
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new[] {"value1", "value2"};
        }

        // GET api/values/5
        [HttpGet("{first}/{second}/{third}")]
        public string Get(int first, int second, int third)
        {
            _logger.Info($"_logger.Info:{first} x {second} x {third}......");
            return (first * second * third).ToString();
        }

        // POST api/values
        [HttpPost]
        public void Post([FromBody] string value)
        {
        }

        // PUT api/values/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/values/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}